package com.zhangxu.microservice.common.context;

import com.zhangxu.microservice.common.dto.EmployeeContextDTO;

public class EmployeeContextHolder {

    private static final ThreadLocal<EmployeeContextDTO> EMPLOYEE_HOLDER = new ThreadLocal<>();

    public static void set(EmployeeContextDTO employee) {
        EMPLOYEE_HOLDER.set(employee);
    }

    public static EmployeeContextDTO get() {
        return EMPLOYEE_HOLDER.get();
    }

    public static void clear() {
        EMPLOYEE_HOLDER.remove();
    }
}
